package com.example.leetcode.tree;

import com.example.leetcode.tree.common.TreeNode;
import com.example.leetcode.tree.common.TreeUtils;

import java.util.Arrays;
import java.util.List;

/**
 * AC
 */
class Solution104{
    public int maxDepth(TreeNode root) {
        return TreeUtils.getMaxDeep(root);
    }
}

/**
 * 104. 二叉树的最大深度
 */
public class leetcode104 {
    public static void main(String[] args) {

        Integer[] arrP = {3,9,20,null,null,15,7};

        List<Integer> nodeListP = Arrays.asList(arrP);
        TreeNode root = TreeUtils.generateAtreeByBFSList(nodeListP);

        Solution104 solution104 = new Solution104();

        System.out.println("题目结果=====================");
        System.out.println(solution104.maxDepth(root));
    }
}
